import request from '@/utils/request'

// 根据id查询岗位
export const getPostById = (id) =>
  request({
    url: `/sys/post/${id}`,
    method: 'get'
  })

// 分页查询岗位
export const listPostPage = (search) =>
  request({
    url: '/sys/post/list',
    method: 'post',
    data: search
  })

// 查询所有岗位
export const listPostAll = (search) =>
  request({
    url: '/sys/post/listAll',
    method: 'post',
    data: search
  })

// 保存/更新岗位
export const savePost = (post) =>
  request({
    url: '/sys/post/save',
    method: 'post',
    data: post
  })

// 删除岗位
export const deletePost = (post) =>
  request({
    url: '/sys/post/delete',
    method: 'post',
    data: post
  })

// 批量保存/更新岗位
export const bulkInsertPost = (posts) =>
  request({
    url: '/sys/post/bulkInsert',
    method: 'post',
    data: posts
  })

// 批量更新岗位
export const bulkUpdatePost = (posts) =>
  request({
    url: '/sys/post/bulkUpdate',
    method: 'post',
    data: posts
  })

// 批量删除岗位
export const bulkDeletePost = (posts) =>
  request({
    url: '/sys/post/bulkDelete',
    method: 'post',
    data: posts
  }) 